package base

import (
	"fmt"
	"strconv"
)

var name string //变量未初始化，为零值
var age int
var isOk bool

var (
	a int = 0
	b bool
	c float64
	d string
)

func Print() string {
	return fmt.Sprint(name, age, isOk)
}

func Print2() string {
	return strconv.Itoa(a) + strconv.FormatBool(b) + strconv.FormatFloat(c, 'f', 2, 64) + d
}

func Calc(a, b int) (sum, substract int) {
	sum = a + b
	substract = a - b
	return
}

const PI = 3.1415
const E = 2.718

const (
	N1 = 100
	N2
	N3
)

const (
	n1 = iota
	n2
	n3
	n4
)

const (
	b1 = iota
	b2 = 100
	b3
	b4 = iota
)

const b5 = iota
const b6 = iota

const (
	_ = iota
	K = 1 << (10 * iota)
	M = 1 << (10 * iota)
	G = 1 << (10 * iota)
	T = 1 << (10 * iota)
	P = 1 << (10 * iota)
)

const (
	i1, i2 = 1 + iota, 2 + iota
	i3, i4
	i5, i6
)

const (
	a1 = 1 + iota
	a2
	a3
)

func Print3() string {
	return fmt.Sprint(n1, n2, n3, n4)
}

func Print4() string {
	return fmt.Sprint(b1, b2, b3, b4, b5, b6) + fmt.Sprint(" ", K, M, G, T, P)
}

func PrintType() {
	fmt.Printf("type=%T\n", K)
}

func Print5() {
	fmt.Println(i1, i2, i3, i4, i5, i6)
	fmt.Println(a1, a2, a3)
}
